﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Security;
using ESF.SharePoint.Entities;
using Microsoft.Office.Server.ActivityFeed;
using Microsoft.Practices.SharePoint.Common;
using System.Security.Permissions;
using ESF.SharePoint.Utility;

namespace ESF.SharePoint.Mappers
{
    class ActivityEventPropertyMapper
    {

        public static CustomActivityEvent CreateEntity(ActivityEvent activity)
        {
            Validation.ArgumentNotNull(activity, "item");

            activity.ForceLoad();

            CustomActivityEvent entity = new CustomActivityEvent();
            
            entity.ActivityEventId = activity.ActivityEventId;
            entity.ActivityTypeId = activity.ActivityTypeId ;
            entity.ATV = activity.GetATV();
            entity.CreationTime = activity.CreationTime ;
            entity.DateValue = activity.DateValue ;
            entity.EntityId = activity.EntityId ;
            entity.EntityTypeId = activity.EntityTypeId ;
            entity.IsRolledUp = activity.IsRolledUp ;
            entity.ItemPrivacy = activity.ItemPrivacy ;
            entity.LastUpdateTime = activity.LastUpdateTime ;
            entity.Link = activity.Link ;
            entity.Link2 = activity.Link2 ;
            entity.LinksList = activity.LinksList ;
            entity.Name = activity.Name ;
            entity.Owner = activity.Owner;
            entity.PartitionId = activity.PartitionId ;
            entity.PublishDate = activity.PublishDate ;
            entity.Publisher = activity.Publisher;
            entity.Separator = activity.Separator ;
            entity.TemplateVariable = activity.TemplateVariable ;
            entity.Value = activity.Value ;

            return entity;

        }
        
    }
}
